package com.zyf.chapter01.practice.v2;

import com.zyf.chapter01.principle.SOLID.SRP.utils.Gson;
import com.zyf.chapter01.principle.practice.RequestStat;

import java.util.Map;

/**
 * 显示终端 控制台实现
 * @author yifeng
 */
public class ConsoleViewer implements StatViewer{

    @Override
    public void output(Map<String, RequestStat> requestStat, long startTimeInMillis, long endTimeInMillis) {
        System.out.println("Time Span: [ " + startTimeInMillis + "," + endTimeInMillis + " ]");
        Gson gson = new Gson();
        System.out.println(gson.toJson(requestStat));
    }
}
